<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Business extends Model {

	protected $table = "business";

	protected $fillable = [
		'name',
	];

	public $timestamps = false;

	public function activitys() {
		return $this->belongsToMany(Activity::class, 'activityables')->withPivot('id');
	}

	public function types() {
		return $this->belongsToMany(Type::class, 'activityables');
	}

	public function users() {
		return $this->belongsToMany(User::class, 'roles');
	}

	public function maps() {
		return $this->hasMany(Map::class);
	}
}
